///<reference path="../../node_modules/angular2/typings/browser.d.ts"/>
import {Component, provide} from 'angular2/core';
import {RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS} from 'angular2/router';
import {LocationStrategy, HashLocationStrategy} from 'angular2/platform/common';

import {HomeComponent} from './home/home.omponent'
import {HeroComponent} from './hero/hero.component'
import {HeroDetailComponent} from './hero/hero-detail.component';

import {HeroService, Hero} from './hero/hero.service';

@RouteConfig([
  {path: '/', name: 'Home', component: HomeComponent},
  {path: '/hero', name: 'Hero', component: HeroComponent},
  {path: '/hero/:id', name: 'HeroDetail', component: HeroDetailComponent},
])
@Component({
  selector: 'my-app',
  template: '<router-outlet></router-outlet>',
  directives: [ROUTER_DIRECTIVES],
  providers: [ROUTER_PROVIDERS, provide(LocationStrategy,
    {useClass: HashLocationStrategy}), HeroService]
})
export class AppComponent {

  constructor() {
    console.log('We are up and running!');
  }

}